<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
	<script src="/admin/public/html5shiv.min.js"></script>
	<script src="/admin/public/respond.min.js"></script>
<![endif]-->
<!-- Bootstrap core CSS -->
<link href="/admin/public/bootstrap.min.css" title="" rel="stylesheet" />
<link rel="stylesheet" href="/admin/css/plugins/toastr/toastr.min.css" />
<link rel="stylesheet" href="/admin/css/templet_form.css" />
<link rel="stylesheet" type="text/css" href="${request.getContext }/admin/css/xcConfirm.css"/>
<link href="/admin/font-awesome/css/font-awesome.min.css"
	rel="stylesheet">
<!-- 时间控件样式 -->
<link href="/admin/css/plugins/datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<link href="/admin/public/animate.css" rel="stylesheet">
<link rel="stylesheet" href="/admin/public/inspinia.css" />
<link rel="stylesheet" href="/admin/css/templet_form.css" />
<!-- 图片放大缩小 -->
<link href="/admin/css/YLlightbox.css" rel="stylesheet" type="text/css">
<title>训练营约课详情</title>
<style>
th.prev {
	background: url(img/dateleft.png) -3px !important;
}

th.next {
	background: url(img/dateright.png) -10px !important;
}

.tr_active {
	background: #FEF388 !important;
}

.left_b_table {
	width: 65%;
	min-width: 700px;
	min-height: 300px;
	float: left;
}

.right_map_box {
	margin-left: 20px;
	width: 33%;
	float: left;
}

.right_map_box2,.right_map_box22 {
	margin-left: 20px;
	width: 33%;
	float: left;
}

.right_map_box3,.right_map_box33  {
	margin-left: 20px;
	width: 33%;
	float: left;
}

.right_map_box4,.right_map_box44 {
	margin-left: 20px;
	width: 33%;
	float: left;
}

.right_map_box {
	float: right;
}

.tab_list {
	overflow: hidden;
	border-bottom: 1px solid #ddd;
}

.tab_box {
	overflow: hidden;
	/*display: inline-block;*/
}

.tab_list .search_inp {
	display: inline-block;
	float: right;
}

.tab_box, .tab_box>li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tab_box>li {
	padding: 10px 15px;
	float: left;
	cursor: pointer;
}

.tab_box>li.select_tab {
	border-bottom: 3px solid #09c;
}

.table_content>div, .table_content2>div, .table_content3>div,
	.right_tab_box>div, .right_tab_box2>div, .right_tab_box3>div,
	.right_tab_box4>div,.right_tab_box22>div, .right_tab_box33>div,
	.right_tab_box44>div, .top_tab_box>div {
	display: none;
}

.table_content>div.active, .right_tab_box>div.active, .right_tab_box2>div.active,
	.right_tab_box3>div.active, .right_tab_box4>div.active,.right_tab_box22>div.active,
	.right_tab_box33>div.active, .right_tab_box44>div.active, .top_tab_box>div.active,
	.table_content2>div.active, .table_content3>div.active {
	display: block;
}
/*
	设置按钮里面字体的颜色
*/
table a {
	color: white !important;
}
</style>
</head>
<body>
	<div id="wrapper" class="container">
		<!--标编辑-->
		<div id="biaobj" class=" wrapper wrapper-content animated fadeInRight">
			<h3>训练营约课详情</h3>
			<div class="right_box" id="right_box">
			<input type="button" style="width:82px;height:34px; margin-left: 12px" onclick="fh();" value="返回"  class="btn btn-success"/>
				<div class="tab_list">
					<ul class="tab_box">
						<li onclick="yuyue('${coursesInfoId }');" class="select_tab">购买人员</li>
						<li onclick="paidui('${coursesInfoId }');">排队购买人员</li>
					</ul>
				</div>
				<div class="top_tab_box"
					style="min-height: 300px; padding-bottom: 0px; margin-top: 20px;">
					<!-- 1111 -->
					<div class="active">
					<input type="hidden" name="coursesInfoId" id="cid" value="${coursesInfoId }" />
						<!--上部表格部分-->
						<div id="top_table" class="ibox-content" style="margin-top: 20px;">
							<div class="row">
								<div class="col-sm-12">
									<table
										class="table table-striped table-bordered table-hover dataTables-example">
										<thead>
											<tr>
												<th>微信昵称</th>
												<th>头像</th>
												<th>性别</th>
												<th>类型</th>
												<th>训练营名称</th>
												<th>开营时间</th>
											</tr>
										</thead>
										<tbody id="lis">
										</tbody>
									</table>
								</div>
							</div>
							<div class="row" id="pa">
						</div>
						</div>
					</div>
					<!-- 2222 -->
					<div>
						<div class="row">
							<input type="button" style="width:82px;height:34px; margin-left: 12px" onclick="lineTK('${coursesInfoId }');" value="排队退款"  class="btn btn-success"/>
						</div>
						<!--上部表格部分-->
						<div id="top_table" class="ibox-content" style="margin-top: 20px;">
							<div class="row">
								<div class="col-sm-12">
									<table
										class="table table-striped table-bordered table-hover dataTables-example">
										<thead>
											<tr>
												<th>微信昵称</th>
												<th>头像</th>
												<th>性别</th>
												<th>类型</th>
												<th>训练营名称</th>
												<th>状态</th>
												<th>排队时间</th>
											</tr>
										</thead>
										<tbody id="pd">
										</tbody>
									</table>
								</div>
							</div>
							<div class="row" id="paidui">
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script src="/admin/public/jquery-1.11.3.js"></script>
	<script src="/admin/public/bootstrap.min.js" type="text/javascript"></script>
	<script src="/admin/js/plugins/lhgdialog/lhgdialog.js"></script>
	<!-- 弹出警示框 -->
	<script src="/admin/js/plugins/toastr/toastr.min.js"></script>
	<!-- 弹出确认框 -->
	<script src="/admin/public/artDialog4.1.7/artDialog.js?skin=blue"></script>
	<script src="/admin/public/artDialog4.1.7/plugins/iframeTools.js"></script>
	<script src="/admin/js/templet_form.js"></script>
	<script src="${request.getContext }/admin/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
	<script>
$('#right_box>.tab_list>.tab_box>li').click(function() {
$(this).addClass('select_tab').siblings().removeClass('select_tab');
var index = $(this).index();
$('.top_tab_box>div:eq(' + index + ')').addClass('active').siblings().removeClass('active');
})

function lineTK(cid){
	window.wxc.xcConfirm("确定要退款吗？", window.wxc.xcConfirm.typeEnum.confirm,{onOk:function(){ 
			$.post("/courses/lineTK",{"cid":cid},
			function(data){
				window.wxc.xcConfirm(data.msg, window.wxc.xcConfirm.typeEnum.info,
					{onOk:function(){window.location.href="/courses/cournfo?coursesType=2";}}
			)
			});
		}})
}

//返回
function fh(){
	window.location.href="/courses/cournfo?coursesType=2";
}
function han(pn){
	document.getElementById("yin").value=pn;
	var cid = document.getElementById("cid").value;
	yuyue(cid);
}
function changeItem(size) {
	document.getElementById("tiaoshu").value=size;
	var cid = document.getElementById("cid").value;
	yuyue(cid);
 }
$(function(){
	var cid = document.getElementById("cid").value;
	yuyue(cid);
})

function yuyue(cid){
	var pagesize = $("#tiaoshu").val();
	var yehao=$("#yin").val();
	$.ajax({
		type:"get",
		data:{"pageSize":pagesize,"yehao":yehao,"cid":cid,"r":Math.random()},
        url:"/courses/xlydetaildetal",
        dataType:"json",
        success:function(data){
        	var str="";
			var shang=data.page.pageNow-1;
			var xia=data.page.pageNow+1; 
			var tr="";
			$("#lis").empty();
			for(var i=0;i<data.list.length;i++){
				if(data.list[i].sex==1){
					var sex='男';
				}
				if(data.list[i].sex==2){
					var sex='女';
				}
				if(data.list[i].userType==0){
					var type='后台管理员';
				}
				if(data.list[i].userType==1){
					var type='前台用户';
				}
				if(data.list[i].userType==2){
					var type='教练';
				}
				tr+="<tr>";
				tr+="<td>"+data.list[i].userName+"</td>";
				tr+="<td>";
				tr+='<div class="YLlightbox" style="text-align: center;">';
				tr+='<img src="'+data.list[i].userUrl+'"style="width: 25px; height: 25px;">';
				tr+="</div>";
				tr+="</td>";
				tr+="<td>"+sex+"</td>";
				tr+="<td>"+type+"</td>";
				tr+="<td>"+data.list[i].coursesName+"</td>";
				tr+="<td>"+data.list[i].xlystartTime+"</td>";
				tr+="</tr>";
			}
			$("#lis").append(tr);
			$("#pa").empty();
			var pageNow;
		    if(data.page.totalPageCount==0){
		    	pageNow=0;
		    }else{
		    	pageNow=data.page.pageNow;
		    }
		    var pageSize=data.page.pageSize;
		    var pageNow=data.page.pageNow;
		    var totalCount=data.page.totalCount;
		    var zong=data.zong;
		    str+='<form action="" id="for" name="for" method="post">';
		    str+='<input type="hidden" name="yehao" id="yin" value="1">';
		    str+='<input type="hidden" name="pagesize" id="tiaoshu" value="'+pageSize+'">';
		    str+='<div class="fy">';
		    str+='<span style="float: left;">每页条数：</span>' ;
		    str+='<select style="width: 70px; float: left;" onchange="changeItem(this.value)" id="pagesize" name="pageSize">';
		    str+='<option value="10" >10</option>';
		    str+='<option value="20" >20</option>';
		    str+='<option value="50" >50</option>';
		    str+='<option value="100" >100</option>';
		    str+='<option value="200" >200</option>';
		    str+='</select>';
		    str+='<div style="height: 27px;" class="col-sm-7">';
		    str+='<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">';
		    str+='<ul class="pagination pull-right" style="margin: -3px 0;">';
		    str+='<li class="paginate_button previous" id="editable_previous">';
		    str+='<a href="javascript:han('+shang+')" aria-controls="editable" data-dt-idx="0" tabindex="0">上一页</a>';
		    str+='</li>';
		    str+='<li class="paginate_button previous" id="editable_previous">';
		    str+='<a aria-controls="editable" style="border: 0" data-dt-idx="0" tabindex="1"><input type="text" id="current" style="width: 32px; height: 19px; text-align: center;"value="'+pageNow+'" /> /'+zong+'</a>';
		    str+='</li>';
		    str+='<li class="paginate_button previous" id="editable_previous">';
		    str+='<a href="javascript:han('+xia+')" aria-controls="editable" data-dt-idx="0" tabindex="5">下一页</a>';
		    str+='<a href="javascript:han($(\''+'#current'+'\').val())" aria-controls="editable" data-dt-idx="0" tabindex="5">跳转</a>';
		    str+='</li>';
		    str+='</ul>';
		    str+='</div>';
		    str+='</div>';
		    str+='<div style="float: right;">总共'+totalCount+'条</div>';
		    str+='</div>';
		    str+='</form>';
			$("#pa").append(str);	
		    $("#pagesize").val(data.page.pageSize);
        }
	})
}
//排队列表
function han1(pn){
	alert(pn)
	document.getElementById("yin1").value=pn;
	var cid = document.getElementById("cid").value;
	paidui(cid);
}
function changeItem1(size) {
	document.getElementById("tiaoshu1").value=size;
	var cid = document.getElementById("cid").value;
	paidui(cid);
 }

function paidui(cid){
	var pagesize = $("#tiaoshu1").val();
	var yehao=$("#yin1").val();
	$.ajax({
		type:"get",
		data:{"pageSize":pagesize,"yehao":yehao,"cid":cid,"r":Math.random()},
        url:"/courses/xlyline",
        dataType:"json",
        success:function(data){
        	var str="";
			var shang=data.page.pageNow-1;
			var xia=data.page.pageNow+1; 
			var tr="";
			$("#pd").empty();
			for(var i=0;i<data.list.length;i++){
				if(data.list[i].sex==1){
					var sex='男';
				}
				if(data.list[i].sex==2){
					var sex='女';
				}
				if(data.list[i].userType==0){
					var type='后台管理员';
				}
				if(data.list[i].userType==1){
					var type='前台用户';
				}
				if(data.list[i].userType==2){
					var type='教练';
				}
				if(data.list[i].status==0){
					var status='排队中';
				}
				if(data.list[i].status==1){
					var status='已排上';
				}
				if(data.list[i].status==2){
					var status='已退款';
				}
				tr+="<tr>";
				tr+="<td>"+data.list[i].userName+"</td>";
				tr+="<td>";
				tr+='<div class="YLlightbox" style="text-align: center;">';
				tr+='<img src="'+data.list[i].userUrl+'"style="width: 25px; height: 25px;">';
				tr+="</div>";
				tr+="</td>";
				tr+="<td>"+sex+"</td>";
				tr+="<td>"+type+"</td>";
				tr+="<td>"+data.list[i].coursesName+"</td>";
				tr+="<td>"+status+"</td>";
				tr+="<td>"+data.list[i].lineTime+"</td>";
				tr+="</tr>";
			}
			$("#pd").append(tr);
			$("#paidui").empty();
			var pageNow;
		    if(data.page.totalPageCount==0){
		    	pageNow=0;
		    }else{
		    	pageNow=data.page.pageNow;
		    }
		    var pageSize=data.page.pageSize;
		    var pageNow=data.page.pageNow;
		    var totalCount=data.page.totalCount;
		    var zong=data.zong;
		    str+='<form action="" id="for" name="for" method="post">';
		    str+='<input type="hidden" name="yehao" id="yin1" value="1">';
		    str+='<input type="hidden" name="pagesize" id="tiaoshu1" value="'+pageSize+'">';
		    str+='<div class="fy">';
		    str+='<span style="float: left;">每页条数：</span>' ;
		    str+='<select style="width: 70px; float: left;" onchange="changeItem1(this.value)" id="pagesize1" name="pageSize1">';
		    str+='<option value="10" >10</option>';
		    str+='<option value="20" >20</option>';
		    str+='<option value="50" >50</option>';
		    str+='<option value="100" >100</option>';
		    str+='<option value="200" >200</option>';
		    str+='</select>';
		    str+='<div style="height: 27px;" class="col-sm-7">';
		    str+='<div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">';
		    str+='<ul class="pagination pull-right" style="margin: -3px 0;">';
		    str+='<li class="paginate_button previous" id="editable_previous">';
		    str+='<a href="javascript:han1('+shang+')" aria-controls="editable" data-dt-idx="0" tabindex="0">上一页</a>';
		    str+='</li>';
		    str+='<li class="paginate_button previous" id="editable_previous">';
		    str+='<a aria-controls="editable" style="border: 0" data-dt-idx="0" tabindex="1"><input type="text" id="current1" style="width: 32px; height: 19px; text-align: center;"value="'+pageNow+'" /> /'+zong+'</a>';
		    str+='</li>';
		    str+='<li class="paginate_button previous" id="editable_previous">';
		    str+='<a href="javascript:han1('+xia+')" aria-controls="editable" data-dt-idx="0" tabindex="5">下一页</a>';
		    str+='<a href="javascript:han1($(\''+'#current1'+'\').val())" aria-controls="editable" data-dt-idx="0" tabindex="5">跳转</a>';
		    str+='</li>';
		    str+='</ul>';
		    str+='</div>';
		    str+='</div>';
		    str+='<div style="float: right;">总共'+totalCount+'条</div>';
		    str+='</div>';
		    str+='</form>';
			$("#paidui").append(str);	
		    $("#pagesize1").val(data.page.pageSize);
        }
	})
}
</script>
</body>
</html>